﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WoSoft.PACS.Data.Patient;
using WoSoft.PACS.Data.Models;
using DevComponents.DotNetBar.SuperGrid;

namespace WoSoft.PACS.Win.Forms.SubForms
{
    public partial class FrmCheckAppBrInfo : FrmBase
    {
        public DataRow dataRow = null;
        private DataTable dt_BrInfo = null;

        public FrmCheckAppBrInfo(DataTable BrInfo)
        {
            InitializeComponent();
            dt_BrInfo = BrInfo;
        }

        //确定选择
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (object.Equals(dataGridView.CurrentRow, null)) return;

            string brid = dataGridView.CurrentRow.Cells["brid"].Value.ToString();
            string xmbh = dataGridView.CurrentRow.Cells["xmbh"].Value.ToString();
            dataRow = dt_BrInfo.Select("brid='" + brid + "' and xmbh='" + xmbh + "'")[0];
            this.DialogResult = DialogResult.OK;
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }

        private void superGridControl1_CellDoubleClick(object sender, GridCellDoubleClickEventArgs e)
        {
            btnOK_Click(null, null);
        }

        private void FrmCheckAppBrInfo_Load(object sender, EventArgs e)
        {
            dataGridView.AutoGenerateColumns = false;
            dataGridView.DataSource = dt_BrInfo;
        }

        private void dataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            btnOK_Click(null, null);
        }
    }
}

